<template>
	<view class="container">
		<uni-section title="评论列表展示"  type="line" >
			<uni-list >
				<uni-list-item :title="item.comment" :rightText="item.postdate" :to="'../commentdetail/commentdetail?id='+item.id"  v-for="item in commentlist"></uni-list-item>
			</uni-list>
		</uni-section>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				commentlist:[]
			}
		},
		methods: {

		},
	onLoad() {
		uni.request({
			url: 'http://localhost:8090/foodapp/comment/list',
			method: 'POST',
			success: res => {
				if(res.data.success){
					this.commentlist=res.data.list
					console.log(this.commentlist);
				}
			}
		});
	}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
